#!/bin/bash
# env
yum -y install unzip zip vim git wget dos2unix
dos2unix Makefile
dos2unix mod_bcg729.c
make 
make install

#del default g729
sed -i "/g729/d"  /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml
#add new g729 codes
sed -i "s/<\/modules>/<load module=\"mod_bcg729\"\/>\\n<\/modules>/g" /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml
#sed -i "s/<\/modules>/<load module=\"mod_g729\"\/>\\n<\/modules>/g"   /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml
#rm -rf Makefile
#rm -rf bcg729*
#rm -rf mod_bcg*
#/usr/local/freeswitch/bin/fs_cli -x "reload mod_bcg729"